<template>
  <div>
    <div v-for="(and, index) in arr" :key="index" style="display: inline-block">
      <input type="checkbox" v-model="shu" :value="and" />
      <span>{{ and }}</span>
    </div>
    <p>你所选中的元素和为{{ he }}</p>
  </div>
</template>

<script>
export default {
  data() {
    return {
      shu: [],
      arr: [9, 15, 19, 25, 29, 31, 48, 57, 62, 79, 87],
    };
  },
  computed: {
    he() {
      return this.shu.reduce((sum, aav) => {
        return (sum += aav);
      }, 0);
    },
  },
};
</script>

<style>
</style>